package com.tac.common;

import lombok.Data;

@Data
public class R<T> {
    private Integer cod;
    private String msg;
    private T data;

    public static <T> R<T> success(T data,String msg){
        R<T> r = new R<>();
        r.msg=msg;
        r.data=data;
        r.cod=1;
        return  r;
    }
    public static <T> R<T> error(String msg){
        R r = new R();
        r.msg=msg;
        r.cod=0;
        return  r;
    }
}
